package com.liao.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.liao.common.entity.product.ProductEntity;
import com.liao.common.to.mq.StockLockedTo;
import com.liao.common.to.order.OrderTo;
import com.liao.common.utils.PageUtils;
import com.liao.common.vo.product.ProductDetailVO;
import com.liao.common.vo.product.ProductSaveReq;

import java.util.Map;

/**
 * 商品SPU信息表
 *
 * @author liao
 * @email 2858015963@qq.com
 * @date 2025-02-13 13:26:53
 */
public interface ProductService extends IService<ProductEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 添加商品
     *
     * @param saveReq
     */
    void save(ProductSaveReq saveReq);

    /**
     * 根据 category_id 查询 ProductImgsEntity 数量
     *
     * @param CategoryId
     * @return
     */
    Integer getProductCountByCategoryId(Integer CategoryId);

    void unlockStock(StockLockedTo to);

    void unLockStock(OrderTo order);

    ProductDetailVO getDetail(Integer id);

}

